package com.settle4you.module.base.controller;

import com.settle4you.module.base.dao.UserMapper;
import com.settle4you.module.base.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by L on 2018/9/4.
 */
@Controller
public class BaseController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/")
    public String index(ModelMap map) {
        // 加入一个属性，用来在模板中读取
        map.addAttribute("host", "http://cloud.settle4you.com");


        User user = userMapper.selectByPrimaryKey(1);


        System.out.println(user);

        // return模板文件的名称，对应src/main/resources/templates/index.html
        return "index";
    }



}
